\chapter{SIP call generation}
\label{sipgeneration}

SiIPp \cite{www:sipp} is used to generate calls to our Asterisk PBX server. We use echo testing scenario and use UAC with RTP data to simulate a real VoIP call. We have followed the guidance of \cite{www:sippPerformance} and \cite{www:sippPerformWiki} to create a sip call generator of our own. 

\section{SIPp installation}
SIPp can be installed under FreeBSD via the ports tree.

\begin{verbatim}
#cd /usr/ports/benechmarks/sipp/
#make install clean
\end{verbatim}


\section{Asterisk Configuration}
Each Asterisk PBX ran 9 clients that would randomly generate a phone call. 
\begin{center}
\begin{tabular}{lll}
PBX1&PBX2&PBX3\\
\hline
2001&3001&4001\\
2002&3002&4002\\
2003&3003&4003\\
2004&3004&4004\\
2005&3005&4005\\
2006&3006&4006\\
2007&3007&4007\\
2008&3008&4008\\
2009&3009&4009
\end{tabular}
\end{center}

The following sip entries were added sip.conf. 
\begin{verbatim}
[2000]
type=friend
host=192.168.18.36
canreinvite=no
nat=yes
context=extension
\end{verbatim}

We set up extension numbers for each client to call and receive a simple playback from Asterisk as with any voice menu. Any number from X020 - X030 is considered an internal call. The following table describes the types of calls our sip generator creates. All calls must dial 0 to dial an outside line. 

\begin{center}
\begin{tabular}{lll}
Number Dialed & Type of Call & Sound File\\
\hline
X020 - X030& Internal Call & Play Demo\\
09214XXXX or 0039214XXXX&Local Call&Play Demo\\ 
0029214XXXX & Interstate Call & Play Demo \\
0079214XXXX & Interstate Call & Play Demo \\
0089214XXXX & Interstate Call & Play Demo \\
00011XXXXXXXXX& International Call & Play Demo
\end{tabular}
\end{center}

\section{SIPp configuration}
SIPp uses XML files to initiate a sip scenario. We use the following XML file to create a scenario of a VoIP client making a call to a random number. We also use SIPp's automation of random users connecting. 

Using a simple python script we randomly fire off sipp clients to make calls at random intervals. SIPp uses a normal distribution for its random intervals. 

\begin{verbatim}

#sipp -bg -sf <custome XML file eg. lams-sip-client2002.xml> <pbx ip address> 
-l 1 -inf <random csv to dial random number> -m 1 -d <random call duration>
\end{verbatim}



